package com.bjx.common.security.interceptor;

import cn.dev33.satoken.stp.StpInterface;
import cn.dev33.satoken.stp.StpUtil;
import com.bjx.common.security.domain.LoginUserVO;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class StpInterfaceImpl implements StpInterface {
    @Override
    public List<String> getPermissionList(Object loginId, String loginType) {
        LoginUserVO loginUser = (LoginUserVO)StpUtil.getSession().get("loginUser");
        return loginUser.getAuths();
    }

    @Override
    public List<String> getRoleList(Object loginId, String loginType) {
        LoginUserVO loginUser = (LoginUserVO)StpUtil.getSession().get("loginUser");
        return loginUser.getRoles();
    }
}
